package com.yiqi.lottery.feature.mine.view;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.suozhang.framework.framework.BaseActivity;
import com.yiqi.lottery.R;
import com.yiqi.lottery.entity.bo.StationBo;
import com.yiqi.lottery.entity.bo.WithdrawBo;
import com.yiqi.lottery.feature.mine.contract.StationContract;
import com.yiqi.lottery.feature.mine.dependencies.station.DaggerStationComponent;
import com.yiqi.lottery.feature.mine.dependencies.station.StationPresenterModule;

import javax.inject.Inject;

public class BettingStationInfoActivity extends BaseActivity implements StationContract.View {


    @BindView(R.id.toolbar)
    Toolbar mToolbar;

    @Inject

    StationContract.Presenter mPresenter;
    @BindView(R.id.tv_user_station_name)
    TextView mTvUserStationName;
    @BindView(R.id.tv_user_station_username)
    TextView mTvUserStationUsername;
    @BindView(R.id.tv_user_station_mobile)
    TextView mTvUserStationMobile;
    @BindView(R.id.tv_user_station_phone)
    TextView mTvUserStationPhone;
    @BindView(R.id.tv_user_station_qq)
    TextView mTvUserStationQq;
    @BindView(R.id.tv_user_station_address)
    TextView mTvUserStationAddress;
    @BindView(R.id.tv_user_station_code)
    TextView mTvUserStationCode;

    @Override
    protected int attachLayoutRes() {
        return R.layout.activity_betting_station;
    }

    @Override
    protected void initInjector() {
        DaggerStationComponent.builder().stationPresenterModule(new StationPresenterModule(this)).build().inject(this);
    }

    @Override
    protected void initView() {
        initToolBar(mToolbar, "投注站基本信息", true, true);

    }

    @Override
    protected void initData() {
        mPresenter.getStationInfo();
    }

    @Override
    public void showStationInfoSuccess(StationBo msg) {
        if (msg != null) {
            mTvUserStationName.setText(msg.getShop_name());
            mTvUserStationUsername.setText(msg.getSeller_name());
            mTvUserStationMobile.setText(msg.getPhone());
            mTvUserStationPhone.setText("暂无");
            mTvUserStationQq.setText(msg.getQq());
            mTvUserStationAddress.setText(msg.getAddress());
            mTvUserStationCode.setText(msg.getInvite_code());
        }
    }

    @Override
    public void showEditWithDrawSuccess(String msg) {

    }

    @Override
    public void showGetWithDrawSuccess(WithdrawBo msg) {

    }


    @Override
    public void showError(String msg) {
        showErrorMsg(msg);
    }

}
